package pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Component说明这个类被Spring托管了，注册到容器中
 * Value()给属性赋值
 */
@Component
public class Country {
    public String countryName;

    public String getCountryName() {
        return countryName;
    }
    @Value("意大利")
    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    @Override
    public String toString() {
        return "Country{" +
                "countryName='" + countryName + '\'' +
                '}';
    }
}
